package com.woniu.finance.contorller;

import com.woniu.aop.OperationLogAnnotation;
import com.woniu.finance.entity.Department;
import com.woniu.finance.entity.Finance;
import com.woniu.finance.entity.Records;
import com.woniu.finance.entity.RequestParam;
import com.woniu.finance.entity.vo.RecordsVO;
import com.woniu.finance.service.IPermissionService;
import com.woniu.finance.service.IRecordsService;
import com.woniu.util.utils.HttpResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/finance/records")
public class RecordsController {
    @Autowired
    private IRecordsService recordService;

    /**
     * @Description: 保存部门表信息
     * @Param: [asset]
     * @return: com.woniu.util.utils.HttpResult<?>
     * @Author: 阿水
     * @Date: 2023/4/27
     */
    @PostMapping("saveRecordsMenu")
    @OperationLogAnnotation(operModul = "融资企业-新增部门表", operType = "新增", operDesc = "新增部门表")//操作日志注解
    public HttpResult<?> saveRecordsMenu(@RequestBody Records records) {

        return recordService.saveRecordsMenu(records);
    }

    /**
     * @Description: 根据id删除部门表
     * @Param: [id]
     * @return: com.woniu.util.utils.HttpResult<?>
     * @Author: 阿水
     * @Date: 2023/4/27
     */
    @RequestMapping("removeRecordsMenu")
    @OperationLogAnnotation(operModul = "融资企业-根据id删除部门表", operType = "删除", operDesc = "根据id删除部门表")
//操作日志注解
    public HttpResult<?> removeRecordsMenu(Integer id) {
        return recordService.removeRecordsMenu(id);
    }

    /**
     * @Description: 修改部门表信息
     * @Param: [asset]
     * @return: com.woniu.util.utils.HttpResult<?>
     * @Author: 阿水
     * @Date: 2023/4/27
     */

    @RequestMapping("modifyRecordsMenu")
    @OperationLogAnnotation(operModul = "融资企业-修改部门表", operType = "修改", operDesc = "修改部门表信息")//操作日志注解
    public HttpResult<?> modifyRecordsMenu(@RequestBody Records records) {
        return recordService.modifyRecordsMenu(records);
    }

    /**
     * @Description: 根据id查询部门表
     * @Param: [id]
     * @return: com.woniu.util.utils.HttpResult<?>
     * @Author: 阿水
     * @Date: 2023/4/27
     */
    @RequestMapping("findRecordsMenuById")
    @OperationLogAnnotation(operModul = "融资企业-根据id查询部门表", operType = "查询", operDesc = "根据id查询部门表")
//操作日志注解
    public HttpResult<?> findRecordsMenuById(Integer id) {
        return recordService.findRecordsMenuById(id);
    }

    /**
     * @Description: 查询所有账单表
     * @Param: [id]
     * @return: com.woniu.util.utils.HttpResult<?>
     * @Author: 阿水
     * @Date: 2023/4/27
     */
    @RequestMapping("findAllRecords")
    @OperationLogAnnotation(operModul = "融资企业-查询所有部门表", operType = "查询", operDesc = "查询所有部门表")
//操作日志注解
    public HttpResult<?> findAllRecords(@RequestBody RequestParam<RecordsVO> param) {
        return recordService.findAllByPage(param);
    }

    /**
     * @Description: 根据融资企业id查询账单
     * @Param: [param]
     * @return: com.woniu.util.utils.HttpResult<?>
     * @Author: 阿水
     * @Date: 2023/5/10
     */

    @RequestMapping("findRecordsByFinanceId")
    @OperationLogAnnotation(operModul = "融资企业-查询所有部门表", operType = "查询", operDesc = "根据融资企业id查询账单")
//操作日志注解
    public HttpResult<?> findRecordsByFinanceId(@RequestBody RequestParam<Records> param) {
        return recordService.findRecordsByFinanceId(param);
    }
}
